package com.wss.module.market.ui.goods.detail.adapter;

import com.wss.common.base.adapter.BaseListAdapter;
import com.wss.common.base.adapter.listener.OnListItemClickListener;
import com.wss.common.base.adapter.superadapter.SuperViewHolder;
import com.wss.common.utils.ImageUtils;
import com.wss.module.market.ResourceTable;
import com.wss.module.market.bean.GoodsComment;
import ohos.app.Context;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * Describe：商品评论列表适配器
 * Created by 吴天强 on 2018/11/2.
 */
public class GoodsCommentAdapter extends BaseListAdapter<GoodsComment> {



    /**
     * 常规列表重写该方法
     *
     * @param context     context
     * @param list        数据源
     */
    public GoodsCommentAdapter(Context context, List<GoodsComment> list) {
        super(context,
                list,
                ResourceTable.Layout_market_item_of_goods_comment_list,
                null);

    }

    @Override
    public void onBindData(@NotNull SuperViewHolder holder, int layoutPosition, @NotNull GoodsComment data) {
        ImageUtils.loadImageCircle(holder.findViewById(ResourceTable.Id_iv_head), data.getUserHead());
        holder.setText(ResourceTable.Id_tv_name, data.getUserName());
        holder.setText(ResourceTable.Id_tv_comment, data.getComment());
    }
}
